import request from '@/router/axios';

// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/maintain/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
// 删除
export const remove = (id) => {
  return request({
    url: '/api/hg-equipment/maintain/remove',
    method: 'post',
    params: {
      id
    }
  })
}

// 提交
export const commit = (id) => {
  return request({
    url: '/api/hg-equipment/maintain/commit',
    method: 'get',
    params: {
      id
    }
  })
}

// 详情
export const detail = (id) => {
  return request({
    url: '/api/hg-equipment/maintain/info',
    method: 'get',
    params: {
      id
    }
  })
}

// 获取保养项目列表
export const getProjectList = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/maintain/project/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
// 保存保养项目
export const saveProject = (data) => {
  return request({
    url: '/api/hg-equipment/maintain/project/save',
    method: 'post',
    data: data
  })
}
// 删除保养项目
export const removeProject = (id) => {
  return request({
    url: '/api/hg-equipment/maintain/project/remove',
    method: 'post',
    params: {
      id
    }
  })
}
// 保存保养规范
export const save = (data,projectIds,fileIds) => {
  return request({
    url: '/api/hg-equipment/maintain/save',
    method: 'post',
    data: data,
    params: {
      projectIds,
      fileIds
    }
  })
}
